package com.jvyou.driver.controller;


import cn.dev33.satoken.annotation.SaCheckPermission;
import com.jvyou.driver.domain.vo.PageVo;
import com.jvyou.driver.domain.modal.Result;
import com.jvyou.driver.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * (User)表控制层
 *
 * @author 橘柚
 * @since 2024-08-12 09:34:30
 */
@RestController
@RequestMapping("/user")
public class UserController {
    /**
     * 服务对象
     */
    @Resource
    private UserService userService;

    /**
     * 分页查询数据
     *
     * @param pageNum  当前页码
     * @param pageSize 每页的条数
     * @return 查询结果
     */
    @SaCheckPermission("user.get")
    @GetMapping
    public Result<PageVo> selectAll(@RequestParam(defaultValue = "1") int pageNum,
                                    @RequestParam(defaultValue = "10") int pageSize) {
        return Result.okResult(userService.pageUser(pageNum, pageSize));
    }

}

